package com.mrd.gtimp.business.action;

import com.mrd.framework.utils.HttpUtils;
import com.mrd.gtimp.business.entity.PortDeclaration;
import com.mrd.gtimp.business.service.PortDeclarationBiz;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

import javax.annotation.Resource;

/**
 * <p> application name: gtimp <p> copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * @author yangyl
 */

@Controller
@RequestMapping("/business")
public class PortDeclarationAction {
    private static final long serialVersionUID = 1L;
    // @SuppressWarnings("unused")
    private PortDeclarationBiz portDeclarationBiz;

    private List<PortDeclaration> portDeclarations;

    /**
     * 申报口岸下拉
     */
    @RequestMapping("/portDeclaration-findPortName")
    public String findPortName() {
        String hql = "from com.mrd.gtimp.business.pojo.PortDeclaration";
        portDeclarations = portDeclarationBiz.findEntityByHql(hql, 0, 1000, null);
        //// TODO: 2016/8/15  SUCCESS
        return null;
    }

    /**
     * 根据申报口岸查找报关行
     */
    @RequestMapping("/portDeclaration-findDeclarationByPortName")
    public String findDeclarationByPortName() {
        String port_code = HttpUtils.getParam("port_code");
        String hql = "from com.mrd.gtimp.business.pojo.PortDeclaration pd where "
                + "pd.port_code = '" + port_code + "'";
        portDeclarations = portDeclarationBiz.findEntityByHql(hql, 0, 1000, null);
        //// TODO: 2016/8/15  SUCCESS
        return null;
    }

    @Resource
    public void setPortDeclarationBiz(PortDeclarationBiz portDeclarationBiz) {
        this.portDeclarationBiz = portDeclarationBiz;
    }

    public List<PortDeclaration> getPortDeclarations() {
        return portDeclarations;
    }

    public void setPortDeclarations(List<PortDeclaration> portDeclarations) {
        this.portDeclarations = portDeclarations;
    }

}
